package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.util.Collection;
import java.util.Objects;

@Entity
@Table(name = "terms_payment", schema = "springboot", catalog = "")
public class TermsPayment {
    private int termsId;
    private String termsName;

    private Collection<Contract> contractsByTermsid;

    @Id
    @Column(name = "terms_id")
    public int getTermsId() {
        return termsId;
    }

    public void setTermsId(int termsId) {
        this.termsId = termsId;
    }

    @Basic
    @Column(name = "terms_name")
    public String getTermsName() {
        return termsName;
    }

    public void setTermsName(String termsName) {
        this.termsName = termsName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TermsPayment that = (TermsPayment) o;
        return termsId == that.termsId &&
                Objects.equals(termsName, that.termsName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(termsId, termsName);
    }

  /*  @OneToMany(mappedBy = "terms_payment")
    public Collection<Contract> getContractsByTermsid() {
        return contractsByTermsid;
    }

    public void setContractsByTermsid(Collection<Contract> contractsByTermsid) {
        this.contractsByTermsid = contractsByTermsid;
    }*/
}
